package org.xhnews.notifications;

import net.rim.device.api.notification.NotificationsManager;

public class Event {
    private long _sourceId;
    long _eventId;
    int _priority;
    private int _triggerIndex;
    private long _timeout;

    // Constructor
    public Event( long sourceid, long eventid, int priority, long timeout, int triggerIndex )
    {
        _sourceId = sourceid;
        _eventId = eventid;
        _priority = priority;
        _triggerIndex = triggerIndex;
        _timeout = timeout;
    }

    /**
     * Invoke the event.
     */ 
    void fire()
    {
        NotificationsManager.negotiateDeferredEvent( _sourceId, 0, this, _timeout, _triggerIndex, null );
    }

    /**
     * Cancel the event.
     */    
    void cancel()
    {
        NotificationsManager.cancelDeferredEvent( _sourceId, 0, this, _triggerIndex, null );
    }
}
